package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PartLotMapper;
import com.ruoyi.system.domain.PartLot;
import com.ruoyi.system.service.IPartLotService;

/**
 * 停车场信息Service业务层处理
 *
 * @author ruoyi
 * @date 2024-01-06
 */
@Service
public class PartLotServiceImpl implements IPartLotService {
    @Autowired
    private PartLotMapper partLotMapper;

    /**
     * 查询停车场信息
     *
     * @param partLotId 停车场信息主键
     * @return 停车场信息
     */
    @Override
    public PartLot selectPartLotByPartLotId(Long partLotId) {
        return partLotMapper.selectPartLotByPartLotId(partLotId);
    }

    /**
     * 查询停车场信息列表
     *
     * @param partLot 停车场信息
     * @return 停车场信息
     */
    @Override
    public List<PartLot> selectPartLotList(PartLot partLot) {
        return partLotMapper.selectPartLotList(partLot);
    }

    /**
     * 新增停车场信息
     *
     * @param partLot 停车场信息
     * @return 结果
     */
    @Override
    public int insertPartLot(PartLot partLot) {
        partLot.setCreateTime(DateUtils.getNowDate());
        return partLotMapper.insertPartLot(partLot);
    }

    /**
     * 修改停车场信息
     *
     * @param partLot 停车场信息
     * @return 结果
     */
    @Override
    public int updatePartLot(PartLot partLot) {
        partLot.setUpdateTime(DateUtils.getNowDate());
        return partLotMapper.updatePartLot(partLot);
    }

    /**
     * 批量删除停车场信息
     *
     * @param partLotIds 需要删除的停车场信息主键
     * @return 结果
     */
    @Override
    public int deletePartLotByPartLotIds(Long[] partLotIds) {
        return partLotMapper.deletePartLotByPartLotIds(partLotIds);
    }

    /**
     * 删除停车场信息信息
     *
     * @param partLotId 停车场信息主键
     * @return 结果
     */
    @Override
    public int deletePartLotByPartLotId(Long partLotId) {
        return partLotMapper.deletePartLotByPartLotId(partLotId);
    }
}
